package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TaskInfo;
import com.atguigu.userprofile.util.MysqlUtil;

/**
 * 负责task_info表数据的增删改查操作
 */
public class TaskInfoDao {

    /**
     * 通过taskId获取TaskInfo
     */
    public static TaskInfo selectTaskInfoByTaskId(String taskId ){
        String querySql = " select id , task_name , task_status , task_comment , task_time , task_type , exec_type , " +
                " main_class , file_id , task_args , task_sql , task_exec_level , create_time " +
                " from task_info where id = " + taskId ;
        TaskInfo taskInfo = MysqlUtil.queryOne(querySql, TaskInfo.class, true);
        return taskInfo ;
    }

    public static void main(String[] args) {
        TaskInfo taskInfo = selectTaskInfoByTaskId("1");
        System.out.println(taskInfo);
    }
}
